import tensorflow as tf

tf.enable_eager_execution()

a = tf.constant([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]])
b = tf.reshape(a, [2, 4])

print(b.numpy())